home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / DJLSR111.ZIP / libsrc / c / gen / xmalloc.c < prev    next >
C/C++ Source or Header  |  1992-06-13  |  214b  |  14 lines

  1. #include <stdio.h>
  2. #include <malloc.h>
  3.  
  4. void *xmalloc(size_t size)
  5. {
  6.   void *rv = malloc(size);
  7.   if (rv == 0)
  8.   {
  9.     fprintf(stderr, "Fatal: malloc returned NULL\n");
  10.     exit(1);
  11.   }
  12.   return rv;
  13. }
  14.